﻿<!-- saved from url=(0014)about:internet -->
<html>
<head>
    <title>Observer</title>
    <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../../js/jKinect.js"></script>
    <script type="text/javascript">
        function convertHeadPositionToEyePosition(jointPosition) {
            var scaledJointPosition = jKinect.scaleTo(jointPosition, $(window).width(), $(window).height());
            document.getElementById("position").innerHTML =
                "Head:<br/>x = " + jointPosition.X + "<br/>y = " + jointPosition.Y + "<br/>"
                 + "screen.x = " + scaledJointPosition.X + "<br/>screen.y = " + scaledJointPosition.Y;
            mousex = scaledJointPosition.X;
            mousey = scaledJointPosition.Y;
            jseyesmove()
        }

        $().ready(function () {
            jKinect.initKinect(true, false, undefined, BindGestures);
        });
        function BindGestures() {
            jKinect.bind("HeadPosition", convertHeadPositionToEyePosition);
            jKinect.bind("HandDirection", function (direction) {
                document.getElementById("HandDirection").innerHTML = direction;
                if (direction == "Left, Up") document.location = "../index.htm";
            });

            jKinect.bind("PlayerStatus", function (status) {
                document.getElementById("status").innerHTML = status.PlayersCount + " active players";
            });
            setInterval("jKinect.getNextSkeletonFrame()", 50);
        }
        
    </script>
</head>
<body>
    <script type="text/javascript" src="jsEyes/jsEyes.js">
    </script>
    <div>
        <img src="../img/go-back-icon.png" width="50px" /><br />
        <strong>GO BACK : raise your hand to the Upper Left corner</strong></div>
    <div style="text-align: center">
        <script type="text/javascript">
            jseyes = { img: "face.jpg", w: 400, h: 400 };
            jseye1 = { img: "eye.png", w: 44, h: 44, x: 160, y: 150, xr: 20, yr: 14 };
            jseye2 = { img: "eye.png", w: 44, h: 44, x: 236, y: 150, xr: 20, yr: 14 };
            jseyeswr(400, 50);
            setTimeout("document.onmousemove = function (e) { };", 200);
            
        </script>
    </div>
    <br />
    <br />
    <br />
    <div id="position">
    </div>
    <div id="handDirection">
    </div>
    <div id="status">
    </div>
</body>
</html>
